<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"/>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="name">
        <input type="button" value="确认添加" @click.prevent="add">
    </div>
</body>
<script>
    let app = new Vue({
        el:"#app",
        data:{
            name: ""
        },
        methods: {
            add(){
                $.post("/bookType/add", {name:this.name},function () {
                    location.href="/bookType.html"
                })
            }
        }
    })
</script>
</html>